//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package javax.vpncrypto;

import java.nio.ByteBuffer;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.spec.AlgorithmParameterSpec;

public abstract class MacSpi {
    public MacSpi() {
    }

    protected abstract int engineGetMacLength();

    protected abstract void engineInit(Key var1, AlgorithmParameterSpec var2) throws InvalidKeyException, InvalidAlgorithmParameterException;

    protected abstract void engineUpdate(byte var1);

    protected abstract void engineUpdate(byte[] var1, int var2, int var3);

    protected void engineUpdate(ByteBuffer var1) {
        if (var1.hasRemaining()) {
            int var4;
            if (var1.hasArray()) {
                byte[] var2 = var1.array();
                int var3 = var1.arrayOffset();
                var4 = var1.position();
                int var5 = var1.limit();
                this.engineUpdate(var2, var3 + var4, var5 - var4);
                var1.position(var5);
            } else {
                int var6 = var1.remaining();

                for(byte[] var7 = new byte[CipherSpi.getTempArraySize(var6)]; var6 > 0; var6 -= var4) {
                    var4 = Math.min(var6, var7.length);
                    var1.get(var7, 0, var4);
                    this.engineUpdate(var7, 0, var4);
                }
            }

        }
    }

    protected abstract byte[] engineDoFinal();

    protected abstract void engineReset();

    public Object clone() throws CloneNotSupportedException {
        if (this instanceof Cloneable) {
            return super.clone();
        } else {
            throw new CloneNotSupportedException();
        }
    }
}
